home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Syslog Component / Readme < prev    next >
Encoding:
Text File  |  1995-11-16  |  4.5 KB  |  43 lines  |  [ttro/ttxt]

  1. Syslog Component
  2.  
  3. What It Is
  4.  
  5. This is an example of a fat component built using Symantec C/C++ 8.0.x and Think C 7.0.x.
  6.  
  7. What It Does
  8.  
  9. The component and the interface glue provide an implementation of the Un*x syslog routines.  The man page for the syslog routines is included to see how to use them.
  10.  
  11. There are two extra routines provided that are not part of the normal syslog implementation.  syslogerr() returns the last error encountered in the component.  setsyslogfile() changes the default file written into by the syslog routines (the default file is named syslog and is stored in the system folder).  Also a utility routine HaveComponentMgr() will determine if the component manager is available.
  12.  
  13. Building The Component
  14.  
  15. First build the 68k resource file using Think C 7.0.x.  Name the file that is built 68k Syslog Code.rsrc.
  16.  
  17. Then open the PPC project file Syslog.π and bring it up to date.  This will build the fat code resource and add all of the other resources to the project's resource file.
  18.  
  19. Make a copy of the Syslog.π.rsrc file and name it Syslog Component (at this point you may want to open the resource file and remove the 'TEMP' resource created during the build process).
  20.  
  21. Drag the Syslog Component file on top of the 68k Make thng application.  This changes the type and creator of the resource file to the 'thng' type and the 'BNDL' resource's creator.
  22.  
  23. Drop the Syslog Component on the System Folder; it will be placed in the Extensions Folder.
  24.  
  25. Nuggets Of Truth
  26.  
  27. There are a few things that I learned when creating this component, and I want to share them with you.
  28.  
  29. • The Tech Note QT 05 - Component Manager version 3.0 is incorrect.  The tech note describes how to build a component that can support 68k and/or PPC platforms without building fat code resources.  By using an extended 'thng' resource, you specify the target platform (68k or PPC) and the associated code resource for that platform.  By actually building a component following the spec I found that this is not true.  Using version 4 of the Component Mgr (which I would hope is compatible, otherwise a newer tech note should have been published), I had each of the project files build separate code resources, one for PPC and one for 68k code.  I set up the extended thng resource appropriately, installed the component and rebooted the system.  I found that the system was ignoring the extended thng stuff and only using the code resource specified in the non-extended part of the 'thng' resource.  I can reproduce this (and you could too), but I am not sure if it is really necessary to have fixed (with fat resources and all).
  30.  
  31. • TMPL resources can be easy to create.  I have included a TMPL resource describing the 'thng' type; feel free to take it and use it for whatever you like.  I only wish that ResEdit would allow filler bits when specifying bit fields; having to display 8 radio buttons when only one bit is currently defined is a pain.
  32.  
  33. • Fat code resources are actually easy to create, too.  Change a few settings in the __Build Fat Component.r file and Sym C++ 8.0 will do the rest.  It does take a little longer if you want to understand what's going on.  In a nutshell, the sub project builds a PPC application code fragment which the Rez file _ComponentToResource.r reads into a temporary resource.  Then the settings in __Build Fat Component.r defines how the temporary resource should be built into a code resource (either fat, PPC, whatever).
  34.  
  35. • Symantec's description of how to build code resources has a little to be desired.  In the __Build Fat Component.r file, they include definitions that a programmer is supposed to set before building the resource.  For example, the ProcInfo value for the PPC and 68k routines should be provided for fat resources; the PPC ProcInfo value is easy to generate (if you have created a UPP before, you know where to find the ProcInfo value), but where does the 68k ProcInfo value come from? I sure don't know.  However, I have found that the shrinking fat safe resources don't use the 68k ProcInfo value, so I have opted to use that type of fat resource.  If anybody out there can tell me where to find the 68k ProcInfo value, I would surely appreciate it.
  36.  
  37. Final Words
  38.  
  39. Just the normal legal stuff.  All rights reserved.  Please mention me if you use any of this code.  No warranties implied or expressed.  Not responsible for loss, theft, crashes, natural disasters, environmental damage, mental deterioration, etc.  Use at your own risk.  Do not look directly into the Sun. Etc....
  40.  
  41. Dave Nebinger
  42. dnebing@epix.net
  43.